<template>
  <div class="sidebar">
    <section class="side-item">
      <h4 class="side-title">热门标签</h4>
      <div class="hot-tag">
        <a href="#">Android</a>
        <a href="#">Java</a>
        <a href="#">运维</a>
        <a href="#">前端</a>
        <a href="#">C++</a>
        <a href="#">PHP</a>
        <a href="#">动效</a>
      </div>
    </section>

    <section class="side-item">
      <h4 class="side-title">热门文章</h4>
      <div class="hot-article">
        <a href="#">在iOS开发路上查询的资料</a>
        <a href="#">快速软件开发 第一部分有效开发</a>
        <a href="#">Android开发架构思考及经验总结</a>
        <a href="#">在iOS开发路上查询的资料</a>
        <a href="#">快速软件开发 第一部分有效开发</a>
        <a href="#">Android开发架构思考及经验总结</a>
        <a href="#">在iOS开发路上查询的资料</a>
        <a href="#">快速软件开发 第一部分有效开发</a>
        <a href="#">Android开发架构思考及经验总结</a>
      </div>
    </section>

    <section class="side-item clearfix">
      <h4 class="side-title">热心用户</h4>
      <div class="ardent-user">
        <a href="#"><img src="../assets/user.jpg"/><span>随心前行的唐子清</span></a>
        <a href="#"><img src="../assets/user.jpg"/><span>Android</span></a>
        <a href="#"><img src="../assets/user.jpg"/><span>Android</span></a>
        <a href="#"><img src="../assets/user.jpg"/><span>Android</span></a>
        <a href="#"><img src="../assets/user.jpg"/><span>Android</span></a>
        <a href="#"><img src="../assets/user.jpg"/><span>Android</span></a>
      </div>
    </section>

    <section class="side-item">
      <div class="download-app">
        <P>下载公共控件APP ></P>
        <h4>Flyme Design</h4>
      </div>
      <div class="download-link">
        <a class="scan"><i class="glyphicon glyphicon-qrcode"></i><span>扫码</span>
          <div class="popover-pic">
            <img src="../assets/flyme-design-er.png"/>
          </div>
        </a>
        <a href="#" class="android-link"><i class="glyphicon glyphicon-phone"></i><span>安卓</span></a>
      </div>

    </section>
  </div>
</template>

<script>
  export default {
    name: 'sidebar',
    data () {
      return {
        msg: 'Welcome to Your Vue.js App'
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .sidebar {
    float: left;
    width: calc((100% - 60px) / 3);
    height: auto;
    margin-top: 82px;
  }

  .side-item {
    width: 100%;
    height: auto;
    padding: 30px;
    background: #fff;
    margin-bottom: 20px;
    position: relative;
    font-size: 15px;
  }

  .side-title {
    margin-top: 0;
    border-left: 3px solid #039be5;
    padding-left: 6px;
    box-sizing: border-box;
  }

  .hot-tag a {
    display: inline-block;
    color: #777;
    padding-right: 20px;
    margin-top: 20px;
  }

  .hot-tag a:hover {
    color: #387aff;
  }

  .hot-article a {
    display: block;
    width: 100%;
    color: #777;
    margin-top: 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hot-article a:hover {
    color: #387aff;
  }

  .ardent-user {
    width: 100%;
    height: auto;
  }

  .ardent-user a {
    display: block;
    box-sizing: border-box;
    width: 50%;
    float: left;
    margin-top: 14px;
    padding-right: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .ardent-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  .ardent-user a span {
    margin-left: 10px;
  }

  .ardent-user a:hover span {
    color: #387aff;
  }

  .download-app {
    margin-top: 20px;
  }

  .download-app p {
    color: #777;
    font-family: sc-bold,"Microsoft YaHei";
  }

  .download-app h4 {
    color: #387aff;
    font-family: sc-bold,"Microsoft YaHei";
    font-size: 20px;
  }

  .download-link {
    margin-bottom: 20px;
  }

  .download-link a {
    display: inline-block;
    font-family: sc-bold,"Microsoft YaHei";
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 6px 10px;
    line-height: 20px;
  }

  .download-link a i {
    margin-right: 3px;
    font-size: 14px;
    vertical-align: middle;
    top: 0;
  }

  .download-link span {
    vertical-align: middle;
  }

  .scan {
    background: #9b9b9b;
    cursor: pointer;
  }

  .scan:hover .popover-pic {
    transform: scale(1);
    transform-origin: bottom;
    -webkit-transform: scale(1);
    -webkit-transform-origin: bottom;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
  }

  .android-link {
    background: #7caf49;
  }

  .popover-pic {
    position: absolute;
    top: -70px;
    left: -26px;
    width: 180px;
    height: 180px;
    transform: scale(0);
    transform-origin: bottom;
    -webkit-transform: scale(0);
    -webkit-transform-origin: bottom;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
  }

  .popover-pic img {
    width: 100%;
    height: 100%;
  }

  /*侧边栏媒体查询*/
  @media screen and (max-width: 768px) {
    .sidebar {
      width: 100%;
    }

    .scan {
      display: none !important;
    }

  }
</style>
